﻿using B.S.Traceability.Domain;
using B.S.Traceability.ErrorCode;
using B.S.Traceability.WebAPI.Read.Commands;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace B.S.Traceability.WebAPI.Read.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class ManagementController : ControllerBase
    {
        private readonly IMediator _mediator;

        public ManagementController(IMediator mediator)
        {
            _mediator = mediator;
        }
        /// <summary>
        /// 获取商品表
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<APIResult<APIPaging<Shops>>> GetShoplist([FromQuery]GetShopsCommand request)
        {
            return await _mediator.Send(request);
        }
    }
}
